import { dateFormat } from '@/utils/formatDate.js'

export default {
  data() {
    return {
      type: '0', //1 寻配件
      id: '', //订单号
      list: null, //报价人列表
      pageLoading: false, //初始化加载效果
    }
  },

  onLoad(e) {
    this.type = e.type
    this.id = e.id
    this.getList()
  },

  methods: {
    dateFormat,

    //获取询价人列表
    async getList() {
      let res
      try {
        if (this.type === '1') {
          res = await this.$api.accessory.getInquiryBidding({
            pageIndex: 1,
            pageSize: 100,
            id: this.id,
          })
        }
        if (res.data.length) {
          this.list = res.data
        }
      } catch (err) {
        console.log(err)
      }
      this.pageLoading = true
    },
  },
}
